import { request } from '@ruifox-cms/utils'

//分页获取课程管理
export function selectPageCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/paging',
    method: 'post',
    data
  })
}
//创建课程
export function createCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/create',
    method: 'post',
    data
  })
}
//修改课程
export function updateByIdCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/updateById',
    method: 'post',
    data
  })
}
//修改课程状态
export function changeStatusCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/changeStatus',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//删除课程
export function deleteByIdCourse(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/deleteById',
    method: 'post',
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
  })
}
//批量删除课程
export function deleteByIdsCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/deleteByIds',
    method: 'post',
    data
  })
}

//通过id查询课程
export function selectByIdCourse(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/selectById',
    method: 'get',
    params
  })
}
//获取用户课程
export function getCourseByUser(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/getCourseByUser',
    method: 'get',
    params
  })
}
//我的课程分页查询
export function userCoursePagingCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/userCoursePaging',
    method: 'post',
    data
  })
}
//课程中心分页查询
export function courseCenterPagingCourse(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/courseCenterPaging',
    method: 'post',
    data
  })
}

//分页查询讲师信息
export function pagingLecturer(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/paging',
    method: 'post',
    data
  })
}
//保存讲师信息
export function saveLecturer(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/save',
    method: 'post',
    data
  })
}
//删除讲师
export function deleteLecturer(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//绑定讲师
export function bindLecturer(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/bind',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//解绑讲师
export function unbindLecturer(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/unbind',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//获取课程下的讲师
export function getCourseLecturersLecturer(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/getCourseLecturers',
    method: 'get',
    params
  })
}
//获取课程实例下的讲师
export function getCourseInstanceLecturersLecturer(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/course/lecturer/getCourseInstanceLecturers',
    method: 'get',
    params
  })
}
//添加用户收藏
export function addCollection(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/user/collection/add',
    method: 'get',
    params
  })
}
//删除用户收藏
export function deleteByIdCollection(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/user/collection/deleteById',
    method: 'get',
    params
  })
}
//分页查询用户收藏
export function pagingCollection(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/user/collection/paging',
    method: 'post',
    data
  })
}